﻿using Catalog.API.Model;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Catalog.API.Infrastructure.EntityConfigurations
{
    public class ExpressTypeEntityTypeConfiguration
                : IEntityTypeConfiguration<ExpressType>
    {
        public void Configure(EntityTypeBuilder<ExpressType> builder)
        {
            builder.ToTable("expresstype");

            builder.HasKey(ci => ci.Id);

            builder.Property(ci => ci.Id)
               .UseHiLo("expresstypeseq")
               .IsRequired();
            builder.Property(cb => cb.Name)
               .IsRequired(true);
            builder.Property(cb => cb.Phone)
               .IsRequired(false);
            builder.Property(cb => cb.CreateUserId)
               .IsRequired(true);
            builder.Property(cb => cb.CreateTime)
               .IsRequired(true);

        }
    }
}
